(function() {
	
	var faceBook ={
	         appId:"",		
			 createShare:function(){
				    a = document.createElement('a');  
				    a.type='button';  
				    a.name='fb_share';  
				    a.share_url='';
				    a.href='http://www.facebook.com/sharer.php';  
				    a.innerHTML = 'Share';  
				    document.getElementById('fb_Share').appendChild(a);  
				      
				    s = document.createElement('script');  
				    s.type='text/javascript';  
				    s.src='http://static.ak.fbcdn.net/connect.php/js/FB.Share';  
				    document.getElementById('fb_Share').appendChild(s);
				    if (typeof(FB.Share) != 'undefined') {// make sure it exists  
				    	  // FB.Share.onFirst();  
				    	  // *** UPDATE: 17 Aug 2011 - Thanks to zr0ck who informed  
				    	  // FB has modified their Share script ***  
				    	  // FB.Share.onFirst() no longer exists; you must now instead call:  
				    	  FB.Share.renderPass();  
				    	 // FB.Share.getUrl();
				    }
			 },
			 
			 createLike:function(){
				 var fb = document.createElement('fb:like'); 
				 //fb.setAttribute("href",""); 
				 fb.setAttribute("layout","button_count");
				 fb.setAttribute("show_faces","true");
				 fb.setAttribute("width","350");
				 fb.setAttribute("send","true");
				 document.getElementById("fb_like").appendChild(fb);
				 FB.XFBML.parse(document.getElementById('fb_like'));
			 },

			 createInvite:function(){
				 var p=document.createElement('input');
				 p.type='button';
				 p.setAttribute('class','sendRequestButton');
				 p.value='Invite Friends';
				 p.onclick =function(){
					 FB.ui({method: 'apprequests',
					          message: 'My Great Request'
					        }, function(response){
					        	if (response && response.request_ids) {
			                        alert('\o/');

			                       }
					        });
				 }
				 document.getElementById('fb_MultiInvite').appendChild(p);
			}
//			
//			createComment:function(){
//				 var fb = document.createElement('fb:comments'); 
//				 fb.setAttribute("xid","comment");
//				 fb.setAttribute("href","http://apps.facebook.com/121568571288932/");
//				 fb.setAttribute("canpost","true");
//				 fb.setAttribute("candelete","false");
//				 fb.setAttribute("title","Comments");
//				 fb.setAttribute("simple","true");
//				 document.getElementById("fb_comments").appendChild(fb);
//				 FB.XFBML.parse(document.getElementById('fb_comments'));
//				 FB.Event.subscribe('comment.create', function(response) {
//					    alert("dene");
//					 	var commentQuery=FB.Data.query("SELECT text, fromid FROM comment WHERE post_fbid='"+response.commentID+"' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url='"+response.href+"')");
//						var userQuery = FB.Data.query("SELECT name, uid FROM user WHERE uid in (select fromid from {0})", commentQuery);
//						FB.Data.waitOn([commentQuery, userQuery], function() {
//							// Do whatever you want with the data
//							alert("deneme");
//							console.log(commentQuery.value[0].text);
//							console.log(userQuery.value[0].name)
//							console.log(userQuery.value[0].uid);
//						});
//					});
//				 FB.Event.subscribe('comments.remove',function (response) {
//					          console.log('remove', response);
//					        });
//			}
			/*getComment:function(){
				FB.Event.subscribe('comment.create', function(response) {
					var commentQuery=FB.Data.query("SELECT text, fromid FROM comment WHERE post_fbid='"+response.commentID+"' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url='"+response.href+"')");
					var userQuery = FB.Data.query("SELECT name, uid FROM user WHERE uid in (select fromid from {0})", commentQuery);
					FB.Data.waitOn([commentQuery, userQuery], function() {
						// Do whatever you want with the data
						alert("deneme");
						console.log(commentQuery.value[0].text);
						console.log(userQuery.value[0].name)
						console.log(userQuery.value[0].uid);
					});
				});
			}*/
				}
			
	if(!window.$facebook){
		window.$facebook=faceBook;
	}
})();